package 传智播客_黑马.java高级.reflect反射;

public class Person {

    //成员变量
    private String name;
    public int age;

    private void sayHello(){
        System.out.println("hello");
    }

    //成员方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //构造方法
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person() {
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public void sleep() {
        System.out.println("huhuhu~");
    }

    public void sleep(int i) {
        System.out.println(i + "huhuhu");
    }

    private void eat() {
    System.out.println("无参方法运行");
}
}
